from aeneas.executetask import ExecuteTask
from aeneas.task import Task

# 创建Task对象
config_string = u"task_language=zh|is_text_type=plain|os_task_file_format=ass"
task = Task(config_string=config_string)
task.audio_file_path_absolute = u"your_audio_file.mp3"
task.text_file_path_absolute = u"your_text_file.txt"
task.sync_map_file_path_absolute = u"output.ass"

# 处理Task
ExecuteTask(task).execute()

# 输出同步映射到文件
task.output_sync_map_file()